1. Field of the Invention
This invention relates to a method of and a circuit for decoding compressed picture image data.
2. Description of the Prior Art
A CD-ROM (compact disk read-only memory) is known as a storage medium of a large capacity and is used as an external storage medium for game machines employing a microcomputer, personal computers and so forth.
FIG. 1 shows an exemplary one of conventional microcomputer systems in which a CD-ROM can be used.
Referring to FIG. 1, the microcomputer system shown is applied to a game machine and includes a game machine body 1, a sub-processing section 3 for a CD-ROM 4, and a program cartridge 5.
The game machine body 1 includes a microcomputer including a CPU (central processing unit) 11, a main RAM (random access memory) 13 serving as a working area for the CPU 11, a PPU (picture processing unit) 14 and a video RAM 15. The circuits 11, 13 and 14 are connected to a system bus 19, and the video RAM 15 and a CRT (cathode ray tube) 6 are connected to the PPU 14.
The game machine body 1 further includes a main processing section 20 for audio data including an APU (audio processing unit) 21 and a D/A (digital to analog) converter 24 and having an audio output terminal 25 connected to the D/A converter 24. The APU 21 is connected to the bus 19 and also to the D/A converter 24.
Meanwhile, the sub-processing section 3 is provided in order to make use of a CD-ROM 4 possible and includes a CD player, a CD-ROM decoder and so forth not shown. Thus, picture image data and programs read out from the CD-ROM 4 are processed suitably by the sub-processing section 3 and forwarded into the bus 19.
The program cartridge 5 includes a ROM 51 and a RAM 52. The ROM 51 has required programs stored in advance therein, and the RAM 52 is used, for example, when a game being played is interrupted temporarily, to maintain various data regarding conditions of the game then until the game is resumed later. Thus, the RAM 52 is backed up by a battery 53.
When the cartridge 5 is inserted into a slot 2 of the game machine body 1, the ROM 51 and the RAM 52 thereof are connected to the bus 19 by way of a connector not shown.
In case a game can be played only with the program cartridge 5, after the cartridge 5 is set in position into the slot 2, either the power supply to the game machine body 1 is made available or the game machine body 1 is reset.
Consequently, a program of the ROM 51 is executed by the CPU 11 so that picture image data are formed and written into the video RAM 15 by the PPU 14, and the picture image data of the video RAM 15 are read out in synchronism with horizontal and vertical scanning and supplied to the display 6 so that a picture image is displayed on the display 6.
Further, audio data and a program for decoding such audio data are loaded into the APU 21 by the CPU 11, and the audio data are decoded into a digital audio signal by the APU 21. The digital audio signal is D/A converted into an analog audio signal by the D/A converter 24 and then outputted by way of the terminal 25.
On the other hand, when a game or the like is to be executed using a CD-ROM 4, the CD-ROM 4 will be set in position into the CD player of the sub-processing section 3 while a system cartridge is set as the program cartridge 5 in position into the slot 2.
In this instance, also such system cartridge 5 includes a ROM 51 and a RAM 52. The ROM 51 has an IPL program prepared in advance therein, and the RAM 52 is used, for example, when a game being played is interrupted temporarily, to maintain various data until the game is resumed later. Meanwhile, the CD-ROM has prepared therein an OS (operating system) for using the CD-ROM 4 and various programs for the game.
Thus, after the power supply is made available, the CPU 11 executes the IPL program of the ROM 51 so that the OS and a necessary program of the game are loaded from the CD-ROM 4 into the RAM 13, and then the CPU 11 executes the program loaded in the RAM 13. Consequently, the game can be played with the game machine.
By the way, if it is assumed, for example, that one frame (one screen) of a picture image displayed on the display 6 is constituted from 256 picture elements (horizontal).times.192 picture elements (vertical) and red, green and blue colors of each picture element are individually represented by 5 bits, then the amount of picture image data of one frame is given by ##EQU1##
Meanwhile, the capacity of one sector of the CD-ROM 4 is, in the mode 1 as defined in the specified CD-ROM format, 2 kilobytes and the reproducing rate is 75 sectors/second. In other words, the data transmission rate of the CD-ROM 4 is 150 kilobytes/second.
Accordingly, if those picture image data are recorded as they are onto the CD-ROM 4, then the number of frames per second upon reproduction is
150 kilobytes/90 kilobytes=1.7 frames or less and accordingly, even if it is tried to display an animation, the number of frames will come quite short.
Therefore, in order to display an animation, picture image data of the animation must necessarily be recorded in a compressed form onto the CD-ROM 4 to assure a sufficient number of frames per second.
In case picture image data are recorded in a compressed form in this manner, such processing steps as follows are required in order to display an animation of the picture image data:
I. to reproduce the thus compressed picture image data from the CD-ROM;
II. to write the thus reproduced picture image data once into a buffer memory; and
III. to decode the picture image data in the buffer memory back into original picture image data.
However, when such reproducing processing is executed, if the decoding rate in the paragraph III is lower than the reproducing rate in the paragraph I, then the buffer memory in the paragraph II will overflow.
In this instance, if the buffer memory has a large capacity equal to the capacity of the CD-ROM 4 or so, then no overflow of the buffer memory will occur. However, a buffer memory of such a great capacity is very expensive. Further, since the number of frames per second of a picture image (animation) to be displayed on the display 6 depends upon the decoding rate in the paragraph III, the reproducing rate of the picture image is varied by a performance of the decoding circuit.
Further, even if a decoding circuit of a sufficient performance is used, when the amount of compressed picture image data is varied by contents of a picture image, that is, when the compressed picture image data have a variable length, the time required for decoding of the picture image data is varied by contents of the picture image. Accordingly, a programmer who tries to produce an application program of a game must necessarily program taking a time necessary for decoding of the program into consideration, which is a burden to the programmer.